// 类
export {}

class Person {
    public name: string
    private age: number
    protected gender: boolean

    constructor(name: string, age: number) {
        this.name = name
        this.age = age
        this.gender = true
    }

    sayHi(msg: string): void {
        console.log(`I am ${this.name}, ${msg}`)
    }
}

class Student extends Person {
    private constructor(name: string, age: number) {
        super(name, age)
        console.log(this.gender)
    }

    static create(name: string, age: number) {
        return new Student(name, age)
    }
}

const tom = new Person('tom', 18)
// const nick = new Student('nick', 20)
console.log(tom.name)
// console.log(tom.age)
// console.log(tom.gender)
// console.log(nick.gender)
const nick = Student.create('nick', 20)